//
//  SecondViewController.m
//  UI_19_Homework
//
//  Created by dllo on 16/1/29.
//  Copyright © 2016年 LZB. All rights reserved.
//

#import "SecondViewController.h"
#import "UIImageView+WebCache.h"

@interface SecondViewController ()
@property (strong, nonatomic) IBOutlet UIImageView *movieImageView;

@end

@implementation SecondViewController

- (instancetype)initWithMovieDetailModel:(MovieDetailModel *)movieDetailModel {
    self = [super init];
    if (self) {
        _movieDetailModel = [[MovieDetailModel alloc] init];
        _movieDetailModel = movieDetailModel;
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
//    self.movieImageView = [[UIImageView alloc] initWithFrame:self.view.frame];
    [self.movieImageView sd_setImageWithURL:[NSURL URLWithString:self.movieDetailModel.imagesModel.large]];
    [self.view addSubview:self.movieImageView];
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    [self dismissViewControllerAnimated:YES completion:^{}];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
